<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>angulardemo</title>
</head>
<script src="angular.min.js"></script>
<script>
    var app = angular.module('myApp1',[]);
    //在模块上创建控制器代码controller 参数1:控制器的名字
    app.controller('myController1',function ($scope) {
            $scope.list=[{"name":"王焰","address":"四川南充"},
            {"name":"小孙","address":"四川遂宁"},
            {"name":"mikey","address":"四川遂宁"}]
        $scope.add=function () {
           $scope.a=  parseInt($scope.x)+parseInt($scope.y);
        }
    })

</script>

<body ng-controller="myController1" ng-app="myApp1">
<div >x:<input ng-model="x">+y:<input ng-model="y">
    <button ng-click="add()">=</button>&nbsp;{{a}}
</div>
<div>
    <h3>数据绑定</h3>
    <input ng-model="shen">
    <input ng-model="shen">
</div>
<div>
<h5 ng-repeat="user in list">{{user.name}}---{{user.address}}</h5>
</div>
<div>
    <button ng-click="show()"></button>{{msg}}
</div>
</body>
</html>